<?php
namespace Purse\Model;
use Think\Model;
class PurseChargeModel extends Model {
	protected $connection = 'DB_BASE_DSN';
	protected $tableName = 'qyx_purse_charge'; 
	
	public function getChargeById($chargeid){
		$map['chargeid'] = $chargeid;
		$result = $this->where($map)->find();
		return $result;
	}
	
	public function updateCharge($data){
		$map['chargeid'] = $data['chargeid'];
		$result = $this->where($map)->save($data);
		return $result;
	}
	
	public function addCharge($data){
		$result = $this->add($data);
		return $result;
	}
}


